//
//  SCPersonCenterButton.m
//  Mutal
//
//  Created by TonyStart on 16/10/21.
//  Copyright © 2016年 com.wx. All rights reserved.
//

#import "SCPersonCenterButton.h"

@interface SCPersonCenterButton()

@property(nonatomic,strong)UIImageView *iconView;
@property(nonatomic,strong)UILabel *btnLabel;
@property(nonatomic,strong)UIImageView *btnRightIcon;

@end
@implementation SCPersonCenterButton

-(instancetype)initWithFrame:(CGRect)frame iconStr:(NSString*)iconStr title:(NSString*)titleStr rightIconStr:(NSString*)rightIconStr{
    if (self = [super initWithFrame:frame]) {
        
        [self setupUI:iconStr title:titleStr rightIconStr:rightIconStr];
    }
    return self;
}

-(void)setupUI:(NSString*)iconStr title:(NSString*)titleStr rightIconStr:(NSString*)rightIconStr{
    self.backgroundColor = [UIColor whiteColor];
    _iconView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0,self.frame.size.height , self.frame.size.height)];
    _iconView.image = [UIImage imageNamed:iconStr];
    
    _btnLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_iconView.frame)+10, (self.frame.size.height - 20)/2, 150, 20)];
    _btnLabel.text = titleStr;
    
    _btnRightIcon = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width - self.frame.size.height,(self.frame.size.height - self.frame.size.height/2)/2, self.frame.size.height/2, self.frame.size.height/2)];
    _btnRightIcon.image = [UIImage imageNamed:rightIconStr];
    
    [self addSubview:_btnLabel];
    [self addSubview:_iconView];
    [self addSubview:_btnRightIcon];
    
    
}

@end
